import request from '/@/utils/request';

export function getCombo (comboID:number){
    return request({
        url: '/source/getcombo/'+comboID,
        method: 'get',
      })
}
// 查询模板管理列表
export function listTemplate(itemplateCode:any,Rid:any,data:any) {
    return request({
      url: '/form/list/'+itemplateCode+'/0',
      method: 'post',
      data: data
    })
  }

// 修改保存
export function editForm( templateName:any, id:any,data:any) {
  return request({
    url: `/form/edit/${templateName}/${id}`,
    method: 'post',
    data
  })
}// 修改保存
export function editsForm( templateName:any, data:any) {
  return request({
    url: `/form/edits/${templateName}`,
    method: 'post',
      data:data
  })
}
export function getForm( templateName:any, id:any,data:any) {
  return request({
    url: `/form/get/${templateName}/${id}`,
    method: 'get',
    data
  })
}
// 删除模板管理
export function delTemplate(templateCode:any,table:any,Rids:any) {
    return request({
      url:'/form/delete/'+templateCode,
      method: 'delete',
      data:{
         ids:Rids
      }
    })
  }
// 查询模板管理详细
export function getTemplate(templateCode:any) {
    return request({
      url: '/form/info/'+templateCode,
      method: 'get',
    })
  }
// 取默认值g
export function getDefault(ID:any) {
    return request({
      url: '/source/getdefault/'+ID,
      method: 'get',
    })
  }
  export function getDataGrid(Data:any) {
    return request({
      url: '/source/datagird',
      params: Data,
      method: 'get',
    })
  }
  export function importTemplate(templateCode:any,data:any) {
    return request({
      url:'/form/'+templateCode+'/import',
      method: 'post',
      data:data,
      headers: {'Content-Type': 'multipart/form-data'}
    })
  }
export function multipleEdit(templateCode:any,data:any) {
    return request({
        url:'/form/multiple/'+templateCode,
        method: 'post',
        data:data,
    })
}
  // 新增模板管理
export function addTemplate(templateCode:any,data:any) {
  return request({
    url: '/template/'+templateCode+'/add',
    method: 'post',
    data: data
  })
}
// 修改模板管理
export function editTemplate(templateCode:any,Rid:any,data:any) {
  return request({
    url:  '/template/'+templateCode+'/edit/'+Rid,
    method: 'put',
    data: data
  })
}

export function downTemplate(itemplateCode: any, Rid: any) {
  return request({
    url: '/form/' + itemplateCode + '/download/' + Rid,
    method: 'get'
  })
}

export function GetApproveStatus(tid: any, rid: any) {
  return request({
    url: '/template/getapprovestatus/' + tid + `/` + rid,
      method: 'get',
  })
}

export function addFiles(data:any) {
    return request({
        url: '/file/add',
        method: 'post',
        data:data,
        headers: {'Content-Type': 'multipart/form-data'}
    })
}
export function deleteFiles(data:any) {
    return request({
        url: '/file/delete',
        method: 'delete',
        data: data
    })
}export function getFile(data:any) {
    return request({
        url: '/file/get',
        method: 'get',
        params: {code:data}
    })
}

export function rePost(rid:any, ruid:any) {
    return request({
        url: '/rule/dopost',
        method: 'post',
        data: {ids: rid,id:ruid}
    })
}
export function reSendmsg(rid:any, ruid:any) {
    return request({
        url: '/rule/sengmsg',
        method: 'post',
        data: {ids: rid,id:ruid}
    })
}


// 取默认值g
export function getSelectRule(ID:any, filterExpr:any,pageNum:any,pageSize:any) {
    return request({
        url: '/source/getselectrule/' + ID,
        method: 'get',
        params: {filter: filterExpr,pageNum:pageNum,pageSize:pageSize}
    })
}
// 取钉钉表单
export function getfilter(fid:any) {
    return request({
        url:  '/source/getfilter/'+fid,
        method: 'get',
    })
}
// 修改保存
export function updateRule(id:any,data:any,Rid:any) {
    return request({
        url: `/source/updaterule/${id}`,
        method: 'post',
        data:{filter: data,rid:Rid}
    })
}
// 修改保存
export function loadExpand(data:any) {
    return request({
        url: `/source/expand`,
        method: 'post',
        data: data
    })
}
// 修改保存
export function RunExpand(data:any) {
    return request({
        url: `/source/doexpand`,
        method: 'post',
        data: data
    })
}
// 修改保存
export function formCheck(data:any) {
    return request({
        url: `/form/check`,
        method: 'put',
        data: data
    })
}
// 修改保存
export function getPostLog(data:any) {
    return request({
        url: `/form/postrulelog`,
        method: 'get',
        params: data
    })
}
// 取钉钉ID
export function getdingfileid(templateCode:any,Rid:any) {
    return request({
        url:  '/form/getdingfiles/'+templateCode+'/'+Rid,
        method: 'get'
    })
}
// 上传钉钉文件
export function uploaddingfileid(fileid:any ,code :any) {
    return request({
        url:  '/form/ding/upfile/'+fileid+'/'+code,
        method: 'post'
    })
}

// 表单复制
export function formcopy(id:any ,code :any) {
    return request({
        url:  '/form/copy/'+code+'/'+id,
        method: 'get'
    })
}
// 查询台账
export async function hQueryList(token:string,data:any) {
  return request({
    url:  '/import/SZTZ001/query?token='+token,
    method: 'post',
    data: data
})
}

// 采集上报查询接口
export function hQueryCollectList(token:string,params:any) {
  return request({
    url:  '/import/CJSB001/query?token='+token,
    method: 'post',
    params: params
})
}

// 采集上报新增接口
export function hQueryCollectAdd(token:string,data:any) {
  return request({
    url:  '/import/CJSB001/create?token='+token,
    method: 'post',
    data: data
})
}

//获取token
export function hQueryToken(username:any,passwoord:any) {
  return request({
    url:  '/system/gettoken',
    method: 'get',
    params: {username:username,password:passwoord}
})
}

//查询任务详情
export function hQueryTask(token:any,params:any) {
  return request({
    url:  '/import/DBRW0001/query?token='+token,
    method: 'post',
    params: params
})
}

export function hUpdLoadImg(data:any) {
  return request({
    url:  '/file/add',
    method: 'post',
    data: data
})
}

export function hGetUserTypeId(id:any){
  return request({
    url:  '/system/user/getEdit?id='+id,
    method: 'get'
})
}






export function getLonLatService() {
  return request({
      url:  '/system/latandlong ',
      method: 'get'
  })
}
